package yuan;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version: 1.0
 * @Description: TODO
 * @author: zZmH
 * @date: 2020/09/20 02:43
 */

@SpringBootApplication
@EnableDiscoveryClient
public class DiscoveryProvider7001 {

    public static void main(String[] args) {
        SpringApplication.run(DiscoveryProvider7001.class, args);
    }

    @Value("${server.port}")
    private int port;
    @RestController
    class EchoController {
        @RequestMapping(value = "/echo/{string}", method = RequestMethod.GET)
        public String echo(@PathVariable String string) {
            return "Hello Nacos " + port + "Discovery " + string;
        }
    }

}
